package hari3.tes.soal2;

public class CalculateDifference {
	public static void main(String[] args) {
		
		String startTime = args[0];
		String endTime = args[1];
		
				
		
		int jedaStartTime = startTime.indexOf(":");		
		String jamStartTime = startTime.substring(0, jedaStartTime);
		int intJamStartTime = Integer.parseInt(jamStartTime);
		String menitStartTime = startTime.substring(jedaStartTime+1);
		int intMenitStartTime = Integer.parseInt(menitStartTime);
				
		int jedaEndTime = endTime.indexOf(":");
		String jamEndTime = endTime.substring(0, jedaEndTime);
		int intJamEndTime = Integer.parseInt(jamEndTime);
		String menitEndTime = endTime.substring(jedaEndTime+1);
		int intMenitEndTime = Integer.parseInt(menitEndTime);
		
		int differenceMenit, differenceJam ;
		
		differenceJam = intJamEndTime - intJamStartTime;
		differenceMenit = intMenitEndTime - intMenitStartTime;
		
		if(differenceMenit < 0) {differenceJam--; differenceMenit = 60 + differenceMenit;}  
		if(differenceJam < 0) {differenceJam = 24 + differenceJam;}
		
		if(differenceJam == 0) System.out.println("Time Difference: " + differenceMenit + " minutes");
		else System.out.println("Time Difference: " + differenceJam + " hour "+ differenceMenit + " minutes");
		
	}
}
